package hcn.protocol.brandnew.dengji.bingli;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateAdapter;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 同步电子住院证信息-响应消息(成功)
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class SyncElectronicProofResponse {

    /**
     * 总条数
     */
    @XmlElement(name = "Total")
    private Long total;
    /**
     * 住院记录集合
     */
    @XmlElementWrapper(name = "Records")
    @XmlElement(name = "Record")
    private List<Record> records;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Record {

        /**
         * 就诊医疗机构组织机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 就诊机构名称
         */
        @XmlElement(name = "VisitOrganizationName")
        private String visitOrganizationName;
        /**
         * 病案号码
         */
        @XmlElement(name = "MedicalRecordNumber")
        private String medicalRecordNumber;
        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 出生日期
         */
        @XmlElement(name = "BirthDate")
        @XmlJavaTypeAdapter(DateAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        private Date birthDate;
        /**
         * 年龄（岁）
         */
        @XmlElement(name = "Age")
        private Byte age;
        /**
         * 患者电话号码
         */
        @XmlElement(name = "ContactNo")
        private String contactNo;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        private String idCardCode;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 就诊卡类别代码
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 就诊卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 住院证号
         */
        @XmlElement(name = "HospitalProveCode")
        private String hospitalProveCode;
        /**
         * 出院西医诊断-其他诊断疾病编码
         */
        @XmlElement(name = "DiagnoseCode")
        private String diagnoseCode;
        /**
         * 住院科室名称
         */
        @XmlElement(name = "VisitDeptName")
        private String visitDeptName;
        /**
         * 科室代码
         */
        @XmlElement(name = "VisitDeptId")
        private String visitDeptId;
        /**
         * 员工姓名
         */
        @XmlElement(name = "PersonName")
        private String personName;
        /**
         * 员工ID
         */
        @XmlElement(name = "PersonId")
        private String personId;
        /**
         * 开单日期
         */
        @XmlElement(name = "ProveDate")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date proveDate;

    }

}
